#!/usr/bin/perl
# file: ftp_recent.pl

use strict;
use Net::FTP;

use constant HOST => 'ftp.perl.org';
use constant DIR => '/pub/CPAN';
use constant FILE => 'RECENT';

my $ftp = Net::FTP->new(HOST)   or die "Can't connect: $@\n";
$ftp->login('anonymous')        or die $ftp->message;
$ftp->cwd(DIR)                  or die $ftp->message;
$ftp->get(FILE)                 or die $ftp->message;
$ftp->quit;
warn "File retrived successfully.\n";